<div class="alsProx">
Proximity Threshold =
<input type="number" id="proxThreshold" name="prox"
min="0" max="255" maxlength="3" value="50" onChange="updateProx()" class="proxInput">
<br>Ambient Light Sensor Value =
<output id="alsValue" name="als">?</output>
</div>
.alsProx {
text-align: center;
background-color: grey;
color: black;
border:2px solid black;
border-radius:8px;
margin: 20px;
font-size: 16px;
font-family: sans-serif;
}
.alsProx input[type=number] {
text-align: center;
font-weight: bold;
border:2px solid black;
border-radius:8px;
height: 20px;
width: 50px;
font-size: 16px;
font-family: sans-serif;
}
function updateProx() {
var proxValue = parseInt(document.getElementById('proxThreshold').value);
window.nexpaqAPI.DevMod.send("PROX_THRESHOLD", [proxValue]);
}

function dataHandler() {
var commandType = window.nexpaqAPI.DevMod.last_data.cmdType;
switch (parseInt(commandType)) {
case 10:
document.getElementById('alsValue').value =
window.nexpaqAPI.DevMod.last_data.alsData;
break;
default:
toggleButton();
break;
}
}
Rerun